#!/bin/bash

set +u

for DEBUG_ARGUMENT in $*; do
    if [ "$DEBUG_ARGUMENT" == "--debug" ]; then
	DEBUG_OPTIONS="-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5555"
    fi
done


TMP_JAVA_HOME=`which java`
JAVA_BIN=`dirname $TMP_JAVA_HOME`

if [ -z "$JAVA_HOME" ]; then
    if [ -z "$TMP_JAVA_HOME" ]; then
      echo "Environment variable JAVA_HOME must be set"
      exit -1;
    fi
fi
	

HOME_DIR=`dirname $0`/..

for LIB in $HOME_DIR/lib/*.jar; do
    CLASSPATH=$LIB:$CLASSPATH
done

for LIB in $HOME_DIR/*.jar; do
    CLASSPATH=$LIB:$CLASSPATH
done
CLASSPATH=$HOME_DIR/conf:$CLASSPATH

   	
$JAVA_BIN/java -cp $CLASSPATH $DEBUG_OPTIONS -Xms128m -Xmx256m edu.upf.grupE.main.Bootstrap $*


 



